package com.starlink.client.jd.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * https://open.jdl.com/#/open-business-document/access-guide/157/100
 * {
 *   "key": "c5404864-247e-4b63-ab5b-086ba2fd3af4",
 *   "orderType": "PRE_View:multi",
 *   "version": "2",
 *   "parameters": {
 *     "printName": "JDL Label 01SE",
 *     "contents": [
 *       {
 *         "tempUrl": "https://template-content.jd.com/template-oss?tempCode=jdkd76x130",
 *         "printData": "IL64a4TJ6Kl1rDn4qNdWJMphihBwHeZ0daX3fTQ1Zki8nqc9ML3zAM+uEJgTq3+DWueKc3KFOFCMnOq2d4VAwAUjNYd7utOCKjU/7hetfwUL8vsjBEjYWF/VBXqOdmDj9iyqJcjT4ncFm4yaGhm8yWwVPyQAtp1IkFYPQOV/CgK6OZt/YIlup8+jRejUKkSHwEAL03prwEYOQnm3nm87cMUF8XvYTgOEwobelmJRccfSjM9qqWw0CCm1j9wXE+MOA6SF2eFA10s8aKxh3xYAl4BkFfHmUfJTFLn6nGUQ9YKBwhth1SkYDDowBP+DOGJW7G13veGKKYLwLTytrIW9k2eNPWpPK7S2sVIzp87N4bkrVqL0PNTQT+MgPdr8ic8kKJCbn/wjJTTSh2a9cLuqfUfwZzqwqVmd2o62fqZKhB5yjzzBwUjD7IvSnkOQUkKzUn2V9HGA/hvfk8SzYWIUH+B+AQ158r8BOnwweRKX9gZUOtMDQPM/uXo6PUiruMm/LvWKCUQptYnyCW1cTYZVjJnadEFKGb7E2X7wNW/gHJ9b3/vHAvHp9td7iVSEWr8I/7ON0vlEMpS3FFrJZKXG5QfIE9R5gcVCeuuaQSJ8dudjXs6rIbbTWyKNsmcchO9CTwdQon8b4uNITZtwUnJqymjIvTvdoO7mFd8nHzYXqXD9eyYPRn7uWq4r9Be+JGbIx/EwC9KbY7eLHbI4jlxPnCNNgTuno4OtyHamprwZQT0qO9quD7QFF5EX6sKs2Al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0ECTPhfxsIX8/2gPHZRyP/zoYNbe8/n80vzyH8ILVJRrJAZymMOd1zfBCFmmpAskBh+4pw3GjdOc4WhXxsgDUORDijcP6NgYADo5Xqnfd+DTMzDbmfGHnq1kbBeuE1uG28TC0+3bdWZfgo4PVTtMYNjJoWeElLg04KwECNmQL7EflHBNotRhcextBgpD6OfSHwua+YW4PN6fLWE9w4SzIA4oP9yeqHhIsqbeMdrdHcwIU+2nfLEZ0lh+HVEEjIuwTM7aO1aWA+J5qgBqOhXGfxK0kjLjd7prRKdRrwe5XyjT4+Doqpb/BXP7yCeZYZFZBMrwCFwO4dqmIvtOsR8GWgm9DVUcZJOLLyEACJ0PnbXuaWitKolQkZi6lxaCfWe0QIBdBL+wjykUYyLgeRojpbZdDXfpC7qSy2ey+1EYmEjqo29yqslIJIoGf1ZOgjZ51fWc1jW+QP9lpoRjK34Ew0puBuAqxxEruv9yP01cU9/CpTyAIGHgpGUxlHMyC2pPcJy66BpiCtfr/W69K9wbvFU/rUq+ueq8z3akOrE6YYWbYlFfmmlQT+sRXoIJto8AQ+8uXJYE+nbVt6e9g0GrFTHJ7OrVvhIu4ZSQi0XAz7LDNSOLWPZWrwJXp2G34JJhMA2YyUM3jp93uAE7Fdf+PfQ3mAqAhQHv6xvgW16obqk82Osm4lswiEySSN2GLFnod51AKdk3uZZL+mv3o+VfWRDPxZBrYz1Pw2EBhKGBHj+CBtXYPfFS43YbVhbv+9Xp/ol1SlIT1YEjwS9HAxjSWBsU3nhxQCzaNM/VRzXFR5SSAbaRX7cL/on6Y85MVhBfAgw4=",
 *         "customTempUrl": "https://template-content.jd.com/template-open?templateCode=test76130",
 *         "customData": "{\r\n  \"text\": \"文本变量传值\",\r\n  \"first\": {\r\n    \"secord\": \"二级json数据\"\r\n  },\r\n  \"barcode\": \"112345678 \",\r\n  \"qrcode\": \"http://www.jd.com\",\r\n  \"goods\": [\r\n    {\r\n      \"seq\": \"1\",\r\n      \"goodsname\": \"苹果\",\r\n      \"goodscount\": \"5个\"\r\n    },\r\n    {\r\n      \"seq\": \"2\",\r\n      \"goodsname\": \"水蜜桃\",\r\n      \"goodscount\": \"6个\"\r\n    },\r\n    {\r\n      \"seq\": \"1\",\r\n      \"goodsname\": \"樱桃\",\r\n      \"goodscount\": \"500g\"\r\n    }\r\n  ]\r\n}"
 *       }
 *     ]
 *   }
 * }
 * tempUrl:京东打印模板 必传
 * printData:京东打印数据  必传
 * customTempUrl:自定义打印模板 没有可以不传
 * customData:自定义打印数据  没有可以不传
 * @Auther: zhouyuhang01
 * @Date: 2024/5/27 21:35
 * @Description: PrintPullDataVO
 * @Version 1.0.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PrintPullDataVO implements Serializable {
    private String key;
    /**
     * PRINT:打印操作
     * PRE_View:multi:预览
     */
    private String orderType = "PRINT";
    private String version = "2";
    private Map<String, Object> parameters;

    public PrintPullDataVO toPrintPullDataVO(String key, List<PrintContentsVO> printData){
        PrintPullDataVO pullDataVO = new PrintPullDataVO();
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("printName", "JDL Label 01SE");
        parameters.put("contents",printData);
        pullDataVO.setKey(key);
        pullDataVO.setOrderType(this.orderType);
        pullDataVO.setParameters(parameters);
        return pullDataVO;
    }
}
